﻿using System.Collections.Generic;

namespace SlamCms.Configuration
{
	public class ConfigurationApplicationDictionary : Dictionary<string, ConfigurationApplication>
	{
		public ConfigurationApplicationDictionary(Configuration configuration)
		{
			configuration["Applications.Application"].ForEach(a =>
				this.Add(a["Name"], new ConfigurationApplication(a["Name"], a["Url"], a["FrontEndUrl"], a["AdminUrl"])));
		}
	}

	public class ConfigurationApplication
	{
		public string Name { get; set; }
		public string Url { get; private set; }
		public string FrontEndUrl { get; private set; }
		public string AdminUrl { get; private set; }

		public ConfigurationApplication(string name, string url, string frontEndUrl, string adminUrl)
		{
			Name = name;
			Url = url;
			FrontEndUrl = frontEndUrl;
			AdminUrl = adminUrl;
		}
	}
}
